package com.epic.details.bank.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epic.common.core.entity.R;
import com.epic.details.bank.entity.Bank;
import com.epic.details.bank.service.IBankService;
import com.epic.supplier.dto.QueryDto;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/bankManager")
public class BankController {
    @Resource private IBankService  iBankService;

    @PostMapping("/page")
    public R<IPage<Bank>> selectPage(@RequestBody QueryDto queryDto){
        IPage<Bank> page = iBankService.selectPage(queryDto);
        return R.ok(page);
    }

    /*
     * 增加供应商信息
     * */
    @PostMapping("/insert")
    public R<Integer> insertSupplier(@RequestBody Bank bank){
        return R.ok(iBankService.insertContact(bank));
    }
}
